# Tab module for CROSS

#########################################################################################
#
# Copyright (C) 2008  
# Authors: Aljosa Osep (aljosa.osep@gmail.com), Jernej Kranjec (jernej.kranjec@gmail.com)
# From Faculty of Electrical Engineering and Computer Science, Maribor, Slovenia
# Done at School of Technology, Seinajoki, Finland
# Under mentor Kimmo Salmenjoki (kimmo.salmenjoki@seamk.fi)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################################

# ==================== imports ====================== #
import pygtk            # import pygtk library
pygtk.require('2.0')    # require version 2.o
import gtk 	        # import gtk	

import sys
sys.path.append('Modules/Core')


######################################
# abstractTab class
# other tabs inherits from this class
######################################
class abstractTab:
	# methods
	def init_frame(self):
		self.frame = gtk.Frame()				# create container
		self.frame.set_border_width(2)				# set border width
		self.frame.set_shadow_type(gtk.SHADOW_NONE)		# remove border


	def init_table(self, width, height, _homogeneous=False):
		self.table = gtk.Table(width, height, _homogeneous)	# 2x3 grid for widget positioning
		self.frame.add(self.table)			# adds table to window

	def message_box(self, message):
		self.msg_dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL,gtk.MESSAGE_INFO, gtk.BUTTONS_OK, message)

		self.msg_dialog.run()
		self.msg_dialog.destroy()


	def show_table_frame(self):
		self.table.show()						# show table
		self.frame.show()						# show frame


	def get_frame(self):					# return frame
		return self.frame


	# initialisation
	def __init__(self):
		pass




